home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / DIRS.SWG / 0030_Hiding a Directory.pas < prev    next >
Pascal/Delphi Source File  |  1994-05-26  |  918b  |  37 lines

  1. {
  2. > browsing. Q59 (How do you hide a directory?) leapt out at me as it's
  3. something
  4.  
  5. Q53 actually.
  6.  
  7. > I have been trying to do for ages. However on closer examination the
  8. 'solution'
  9. > proved to be calling the SETFATTR function (either directly or through it's
  10. > DOS interrupt.) This worried me- I am SURE I tried this, and without
  11. success.
  12. > It worked fine for ordinary files, but NOT directories. In fact I have a
  13.  
  14. That's very strange since I have no problems when I test
  15. }
  16.  
  17. uses Dos;
  18.  
  19. procedure HIDE (dirname : string);
  20. var regs : registers;
  21. begin
  22.   FillChar (regs, SizeOf(regs), 0);
  23.   dirname := dirname + #0;
  24.   regs.ah := $43;
  25.   regs.al := $01;
  26.   regs.ds := Seg(dirname[1]);
  27.   regs.dx := Ofs(dirname[1]);
  28.   regs.cx := 2; { set bit 1 on }
  29.   Intr ($21, regs);
  30.   if regs.Flags and FCarry <> 0 then
  31.     writeln ('Failed to hide');
  32. end;  (* hide *)
  33.  
  34. begin
  35.   HIDE ('r:\tmpdir');
  36. end.
  37.